#!/usr/bin/env bash
set -ex

cd $(dirname $0)/..

source ./scripts/version.sh

if [ "${GOARCH}" == "s390x" ] || [ "${GOARCH}" == "arm64" ]; then
    exit 0
fi

DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-1} docker image build \
    --build-arg TAG=${VERSION} \
    --build-arg KUBERNETES_VERSION=${KUBERNETES_VERSION} \
    --build-arg CACHEBUST="$(date +%s%N)" \
    --tag ${REPO}/${PROG}-test:${DOCKERIZED_VERSION} \
    --tag ${REPO}/${PROG}-test:${DOCKERIZED_VERSION}-${GOARCH} \
    --target test \
.
